package com.ruoyi.web.system.controller;

import com.ruoyi.framework.web.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.utils.StringUtils;
import com.ruoyi.web.system.domain.RegisterBody;
import com.ruoyi.web.system.service.impl.SysRegisterService;
import com.ruoyi.framework.web.controller.BaseController;

/**
 * 注册验证
 *
 * @author ruoyi
 */
@RestController
public class SysRegisterController extends BaseController {
    @Autowired
    private SysRegisterService registerService;

    @PostMapping("/register")
    public Result register(@RequestBody RegisterBody user) {
        String msg = registerService.register(user);
        return StringUtils.isEmpty(msg) ? success() : error(msg);
    }
}
